package com.uvnos4j.matilda.system.log;

import cn.hutool.extra.spring.SpringUtil;
import com.uvnos4j.matilda.system.domain.SysLog;
import com.uvnos4j.matilda.system.mapper.SysLogMapper;

/**
 * 日志保存任务
 * <p>
 * Description:日志保存任务
 * </p>
 *
 * @author Guo.wl
 * @version v1.0.0
 * @see com.uvnos4j.matilda.system.log
 * @since 2020-08-31 22:40:57
 */
public class SaveLogRunnable implements Runnable {
    private static SysLogMapper sysLogMapper;

    static {
        sysLogMapper = SpringUtil.getBean(SysLogMapper.class);
    }

    private SysLog log;

    public SaveLogRunnable(SysLog log) {
        this.log = log;
    }

    @Override
    public void run() {
        sysLogMapper.insert(log);
    }
}